Detach Xend from terminal, courtesy of Horms <horms@verge.net.au>.
authoremellor@leeni.uk.xensource.com <emellor@leeni.uk.xensource.com>
Thu, 8 Dec 2005 16:17:53 +0000 (16:17 +0000)
committeremellor@leeni.uk.xensource.com <emellor@leeni.uk.xensource.com>
Thu, 8 Dec 2005 16:17:53 +0000 (16:17 +0000)
commitd2b3b7424b1a35756e8cd2d49866eb1fa9dcab9b
tree94311f65b2b2932781b00ceeb6a5c02580461945
parent72bb6de0e016c567ff17504ac3ca792dc0792471
Detach Xend from terminal, courtesy of Horms <horms@verge.net.au>.

* For setsid to effectively detach a process from the terminal,
  the following needs to occur:

    fork ()   Return control to the shell
    setsid () New session with no controlling terminal
    fork ()   The session leader (parent) exits and thus
              the resulting child process can never regain the terminal

  This patch adds the second fork

* The call to self.daemonize(), which now forks, is moved to
  run before self.tracing(), as now that it actually disconnects
  from the terminal, and thus the prevailing process, the trace
  loses the processes created in self.run().

Signed-off-by: Ewan Mellor <ewan@xensource.com>
tools/python/xen/xend/server/SrvDaemon.py